home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8353 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: gail.ripco.com!mambuhl
  2. From: mambuhl@ripco.com (Martin Ambuhl)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: dereferencing pointer
  5. Date: 3 Mar 1996 09:00:28 GMT
  6. Organization: Ripco Communications, Inc.
  7. Message-ID: <4hbn3c$4q6@gail.ripco.com>
  8. NNTP-Posting-Host: golden.ripco.com
  9.  
  10. D.C.Molero@dcs.warwick.ac.uk (Daniel Castillo Molero)
  11. in <1996Mar3.040741.27234@dcs.warwick.ac.uk> asks:
  12.  
  13.  
  14. :I wonder if anybody can help me to debug the short code below.
  15. :It is supposed to calculate the area of a polygon, but when I compile
  16. :it with  gcc program.c, it gives me the following errors,
  17.  
  18. :program.c: In function `calc_area':
  19. :program.c:22: warning: assignment from incompatible pointer type
  20. :program.c:24: dereferencing pointer to incomplete type
  21. :program.c:24: dereferencing pointer to incomplete type
  22. :program.c:26: warning: assignment from incompatible pointer type
  23.  
  24.  
  25. :which I don't understand at all.
  26.  
  27. Daniel,
  28.     These errors are the result of your mistyping the definition of the
  29. `struct polygon'.  There is no definition for a `struct polyg'.
  30.  
  31. Here is a corrected version:
  32.  
  33.  struct polygon {
  34.      int tried;
  35.      double x, y;
  36.      int dir, numtimes, conv;
  37.      struct polygon *next;       /* mha - was `struct polyg *next;' */
  38.  };
  39.                                                                         
  40. --
  41. * Martin Ambuhl       net: mambuhl@ripco.com
  42. * Chicago, IL (USA)    
  43.